﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/ResponsiveTheme.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TaggerApp.Admin.Pages.AddDevice.Default" ValidateRequest="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<style>  body {padding-top: 60px;padding-bottom: 40px;}      </style>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#allDevices").hide();
            $('#computerData').hide();
            $("#buttons").hide();
            $('#deviceTypeDropDownList').change(function () {
                var selectedValue = $(this).val();
                // no choices selected
                if (selectedValue == "0") {
                    $("#allDevices").hide();
                    $('#computerData').hide();
                    $("#buttons").hide();
                    $('.input-small, .input-medium, .input-large, .input-xlarge, .input-xxlarge').val('');
                }
                    // if desktop selected
                else if (selectedValue == "1") {
                    $("#laptopTabletBattery").hide();
                    $("#laptopTabletDisplay").hide();
                    $("#laptopTabletCamera").hide();
                    $("#allDevices").show();
                    $("#desktopLaptopMedDrive").show();
                    $("#computerData").show();
                    $("#buttons").show();
                    $('.input-small, .input-medium, .input-large, .input-xlarge, .input-xxlarge').val('');
                }
                    // if laptop is selected
                else if (selectedValue == "2") {
                    $("#desktopLaptopMedDrive").hide();
                    $("#allDevices").show();
                    $("#computerData").show();
                    $("#laptopTabletBattery").show();
                    $("#laptopTabletDisplay").show();
                    $("#laptopTabletCamera").show();
                    $("#buttons").show();
                    $('.input-small, .input-medium, .input-large, .input-xlarge, .input-xxlarge').val('');
                }
                    // if tablet is selected
                else if (selectedValue == "3") {
                    $("#desktopLaptopMedDrive").hide();
                    $("#allDevices").show();
                    $('#computerData').show();
                    $("#laptopTabletBattery").show();
                    $("#laptopTabletDisplay").show();
                    $("#laptopTabletCamera").show();
                    $("#buttons").show();
                    $('.input-small, .input-medium, .input-large, .input-xlarge, .input-xxlarge').val('');
                }
                    // if Other device type is selected
                else if (selectedValue == "4") {
                    $('#computerData').hide();
                    $("#allDevices").show();
                    $("#buttons").show();
                    $('.input-small, .input-medium, .input-large, .input-xlarge, .input-xxlarge').val('');
                }
            });
        });            
</script>
<script type="text/javascript" src="../../../tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
    tinyMCE.init({
        mode: "textareas",
        theme: "advanced",
        plugins: "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",
        theme_advanced_buttons1: "bold,italic,underline|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect",
        theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,image,cleanup,code",
        theme_advanced_buttons3: "insertdate,inserttime,|,forecolor,backcolor, | tablecontrols,|,hr,removeformat,iespell",
        theme_advanced_toolbar_location: "top",
        theme_advanced_toolbar_align: "left",
        theme_advanced_statusbar_location: "none",
        theme_advanced_resizing: false,
        template_external_list_url: "js/template_list.js",
        external_link_list_url: "js/link_list.js",
        external_image_list_url: "js/image_list.js",
        media_external_list_url: "js/media_list.js"
    });
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="form-horizontal">
        <tr>
        <td><asp:Label ID="lblDeviceType" runat="server" Text="Device Type"></asp:Label></td>
        <td><asp:DropDownList ID="deviceTypeDropDownList" runat="server" DataSourceID="SqlDSProdTypes" DataTextField="productTypeDesc" DataValueField="productTypeID" ClientIDMode="Static" Height="28px" AppendDataBoundItems="True">
            <asp:ListItem Text="Choose" Value="0"></asp:ListItem>
            </asp:DropDownList>
            <asp:SqlDataSource ID="SqlDSProdTypes" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT * FROM [tblProductType]"></asp:SqlDataSource>
            </td>
            </tr>
    </table>
    <hr />
    <div class="alert alert-success" id="sucessMessage" runat="server">
            Success! Tag has been created. <a href="../AddDevice/">Click Here</a> to create another tag or <a href="../TagManager/">Click Here</a> to view, edit or print tags.</div>
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" HeaderText="Please correct the following errors:" DisplayMode="BulletList" CssClass="alert alert-error" EnableClientScript="true" />
    <hr />
      
    <div class="row">
    <div id="allDevices" class="span6">
        <fieldset>
            <legend>Please enter the required information below.</legend>
                     <table>
                        <tr>
                            <td><asp:Label ID="lblName" runat="server" Text="Name:"></asp:Label></td>
                            <td><asp:TextBox ID="txtBoxName" runat="server" ClientIDMode="Static" CssClass="input-large"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="txtBoxNameReqFldValid" runat="server" ControlToValidate="txtBoxName" Display="Dynamic" ErrorMessage="Name is required." Text="">
                                    <i class="icon-exclamation-sign" title="Name is required."></i>
                                </asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblLocation" runat="server" Text="Location:"></asp:Label></td>
                            <td>
                                <asp:DropDownList ID="locationDropDownList" runat="server" ClientIDMode="Static" DataSourceID="EntityDataSource2" DataTextField="locationName" DataValueField="locationID" Height="28px" ></asp:DropDownList> 
                                <asp:EntityDataSource ID="EntityDataSource2" runat="server" ConnectionString="name=mstaggerEntities" DefaultContainerName="mstaggerEntities" EnableFlattening="False" EntitySetName="tblLocations" Select="it.[locationID], it.[locationName]">
                                </asp:EntityDataSource>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblMfgLink" runat="server" Text="Manufacture Website:"></asp:Label></td>
                            <td><div class="input-prepend"><span class="add-on"><i class="icon-globe"></i></span><asp:TextBox ID="txtBoxMfgLink" runat="server" CssClass="input-xlarge" placeholder="http://www.microsoft.com/surface"></asp:TextBox></div>
                                <asp:RegularExpressionValidator ID="txtBoxMfgLinkRegExpValid" runat="server" ControlToValidate="txtBoxMfgLink" Display="Dynamic" ErrorMessage="Please enter a valid URL" Text="" ValidationExpression="http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&amp;=]*)?">
                                     <i class="icon-exclamation-sign" title="Please enter a valid URL."></i>
                                </asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblDescription" runat="server" Text="Description"></asp:Label></td>
                            <td><asp:TextBox ID="txtBoxDescription" runat="server" TextMode="MultiLine" MaxLength="50"></asp:TextBox></td>
                        </tr>
                    </table>
                </fieldset>
        </div>
    <div id="computerData" class="span6">
        <fieldset>
            <legend>Technical Specifications</legend>
                     <table>
                        <tr>
                            <td><asp:Label ID="lblCPU" runat="server" Text="CPU:"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtBoxCPU" runat="server" CssClass="input-large" ClientIDMode="Static" MaxLength="100" ></asp:TextBox>
                                <asp:RegularExpressionValidator ID="REvalBoxCPU" runat="server" ControlToValidate="txtBoxCPU" ErrorMessage="CPU name must be at least one character and at least one digit." Text="" ValidationExpression="^(?=.*\d)(?=.*[a-zA-Z]).{0,100}$" Display="Dynamic">
                            <i class="icon-exclamation-sign" title="CPU name must be at least one character and at least one digit."></i>
                                </asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblOS" runat="server" Text="Operating System:"></asp:Label></td>
                            <td><asp:TextBox ID="txtBoxOS" runat="server" CssClass="input-medium" MaxLength="50"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblMemory" runat="server" Text="Memory:"></asp:Label></td>
                            <td>
                                <asp:TextBox ID="txtBoxMemory" runat="server" CssClass="input-medium" MaxLength="50"></asp:TextBox>
                                <asp:RegularExpressionValidator ID="REvalBoxMemory" runat="server" ControlToValidate="txtBoxMemory" ErrorMessage="Memory must be at least one character and at least one digit." Text="" ValidationExpression="^(?=.*\d)(?=.*[a-zA-Z]).{0,50}$" Display="Dynamic" >
                            <i class="icon-exclamation-sign" title="Memory must be at least one character and at least one digit."></i>
                                </asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr>
                          <td><asp:Label ID="lblHDStorage" runat="server" Text="Hard Drive:"></asp:Label></td>
                          <td><asp:TextBox ID="txtBoxHD" runat="server" CssClass="input-medium" MaxLength="50"></asp:TextBox>
                                <asp:RegularExpressionValidator ID="REvalBoxHD" runat="server" ControlToValidate="txtBoxHD" ErrorMessage="Hard Drive must be at least one character and at least one digit." Text="" ValidationExpression="^(?=.*\d)(?=.*[a-zA-Z]).{0,50}$" Display="Dynamic">
                       <i class="icon-exclamation-sign" title="Hard Drive must be at least one character and at least one digit."></i>
                                </asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr id="laptopTabletDisplay">
                            <td><asp:Label ID="lblDisplay" runat="server" Text="Display:"></asp:Label></td>
                            <td><asp:TextBox ID="txtBoxDisplay" runat="server" CssClass="input-medium" MaxLength="100"></asp:TextBox>
                                <asp:RegularExpressionValidator ID="REvalBoxDisplay" runat="server" ControlToValidate="txtBoxDisplay" ErrorMessage="Display name must be at least one character and at least one digit."  ValidationExpression="^(?=.*\d)(?=.*[a-zA-Z]).{0,100}$" Display="Dynamic">
                       <i class="icon-exclamation-sign" title="Display must be at least one character and at least one digit."></i>
                                </asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr id="desktopLaptopMedDrive">
                            <td><asp:Label ID="lblMedDrive" runat="server" Text="Media Drive:"></asp:Label></td>
                            <td><asp:TextBox ID="txtBoxMedDrive" runat="server" CssClass="input-medium" MaxLength="50"></asp:TextBox>
                            </td>
                        </tr>
                        <tr id="laptopTabletCamera">
                            <td><asp:Label ID="lblCamera" runat="server" Text="Camera:"></asp:Label></td>
                            <td><asp:TextBox ID="txtBoxCamera" runat="server" CssClass="input-medium" MaxLength="50"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblPorts" runat="server" Text="Ports:"></asp:Label></td>
                            <td><asp:TextBox ID="txtBoxPorts" runat="server" CssClass="input-large" MaxLength="50"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblNetwork" runat="server" Text="Network:"></asp:Label></td>
                            <td><asp:TextBox ID="txtBoxNetwork" runat="server" CssClass="input-large" MaxLength="50"></asp:TextBox>
                                <asp:RegularExpressionValidator ID="REvalBoxNetwork" runat="server" ControlToValidate="txtBoxNetwork" ErrorMessage="Network must be at least one character and at least one digit." Text="" ValidationExpression="^(?=.*\d)(?=.*[a-zA-Z]).{0,50}$" Display="Dynamic">
                       <i class="icon-exclamation-sign" title="Network must be at least one character and at least one digit."></i>
                                </asp:RegularExpressionValidator>
                            </td>
                        </tr>
                        <tr id="laptopTabletBattery">
                            <td><asp:Label ID="Label4" runat="server" Text="Battery:"></asp:Label></td>
                            <td><asp:TextBox ID="txtBoxBattery" runat="server" CssClass="input-medium" MaxLength="50"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td><asp:Label ID="lblImageURL" runat="server" Text="Image URL:"></asp:Label></td>
                            <td><div class="input-prepend"><span class="add-on"><i class="icon-picture"></i></span>
                                <asp:TextBox ID="txtBoxImgURL" runat="server" CssClass="input-xlarge"></asp:TextBox></div>
                            </td>                        
                        </tr>
                          <tr>
                            <td><asp:Label ID="lblVideoURL" runat="server" Text="Video URL:"></asp:Label></td>
                            <td><div class="input-prepend"><span class="add-on"><i class="icon-facetime-video"></i></span><asp:TextBox ID="txtBoxVideo" runat="server" CssClass="input-xlarge" ></asp:TextBox></div>
                            </td>                       

                          </tr>
                    </table>
                </fieldset>
        </div>
                </div>
        <fieldset id="buttons">
            <legend></legend>
            <table>
                   <tr><td><asp:Button ID="btnClear" runat="server" CssClass="btn btn-danger" Text="Clear" CausesValidation="False" OnClick="btnClear_Click1"/>
                        </td>
                        <td><asp:Button ID="btnSave" runat="server" CssClass="btn btn-primary" Text="Add" OnClick="btnSave_Click" CausesValidation="true" /></td>
                   </tr>                
            </table>
        </fieldset>
</asp:Content>